<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();

String basePath = request.getScheme() + "://"
	        + request.getServerName() + ":" + request.getServerPort() + path;
%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="copyright" content="Tencent"/>
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="format-detection" content="telephone=no">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
	<title>我的名片</title>
    <link href="<%=path%>/favicon.ico" rel="shortcut icon">
  <link href="https://cdn.jsdelivr.net/gh/bootcdn/BootCDN/ajax/libs/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
	<link rel="stylesheet" type="text/css" href="<%=path%>/css/marketing/public.css" />
	<link rel="stylesheet" type="text/css" href="<%=path%>/css/marketing/marketing.css" />
	<style>
    	#qrcode img{
	    	width:100%;
	    	border:5px solid #fff;
    	}
    </style>
</head>
<body class="calling_card_body">
    <div class="calling_card fix" id="qy_card">
        <span></span>
        <dl class="fix">
           <dt><img id="head_pic"  onerror="loadDefalutImage(this)" src="<%=path%>/images/marketing/Default_Avatar.png" style="width:100%;"/></dt>
            <dd>
                <h5></h5>
                <em></em>
            </dd>
        </dl>
        <p>
            <img src="<%=path%>/images/marketing/icon_plume.png" />  
        </p>
        <ul class="fix">
            <li><img src="<%=path%>/images/marketing/icon11.png" />  </li>
            <li><img src="<%=path%>/images/marketing/icon22.png" />  </li>
            <li><img src="<%=path%>/images/marketing/icon33.png" />  </li>
            <li><img src="<%=path%>/images/marketing/icon55.png" />  </li>
            <li><img src="<%=path%>/images/marketing/icon66.png" />  </li>
            <li><img src="<%=path%>/images/marketing/icon44.png" />  </li>
        </ul>
        <em class="k_btn_zzmp" style="display: none;"></em>
        <div class="k_ewm_box">
            <div></div>
            <i></i>
        </div>
        <em class="k_icon_right"><img src="<%=path%>/images/marketing/k_icon_right.png" /></em>
    </div>
    <div class="k_phone">
        <dl class="k_title fix" id="info1" style="height: 160px;">
            <dt><img id="micro_pic"  onerror="loadDefalutImage(this)"  src="" ></dt>
                 <dd>
                     <h2 id="micro_name"></h2>
                     <ol id="micro_tag" class="fix">
                        
                     </ol>
                     <span id="micro_score">
                                                                                                    
                     </span>
                     <div id="business_hours" style="overflow:auto;max-height:60px"></div>
                 </dd>
             </dl>
             <ol class="k_detailed fix" id="info11">
                 <li id="micro_address"><img src="<%=path%>/images/marketing/icon_address.png" /></li>
                 <li id="micro_phone"><img src="<%=path%>/images/marketing/icon_phone.png" /></li>
             </ol>
        <div class="k_cut kkkk" id="info2">
            <h1><p>业务介绍</p><i></i></h1>
            <ul class="surrent">
                <div class="k_content" style="margin-bottom: -10px;" id="bm_yewushow">
     
                </div>
            </ul> 
        </div>
        <div class="k_cut kkkk" id="info3">
            <h1><p>我推荐</p><i></i></h1>
           <ul class="surrent"  id = "bm_xianshi">
               
            </ul>
        </div>
        <p class="k_footer">zhfeat提供技术服务</p>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
   <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
     <script type="text/javascript" src="<%=path%>/js/marketing/qrcode.js"></script>
    <script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
    <script src="<%=path%>/js/marketing/public.js"></script>
    <script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
    
    
    <script src="<%=path%>/js/system/province-city-area-data.js"></script>
    
    <script>
        $('.s_like').click(function(){
            var id = $(this).find('img').attr('_id');
            if(id == 1){
                $('.s_dianzan_img').attr('src', '<%=path%>/images/marketing/icon_heart.png');
                $(this).find('img').attr('_id' , '2');
            }else{
                $('.s_dianzan_img').attr('src', '<%=path%>/images/marketing/dianzan.png');
                $(this).find('img').attr('_id' , '1');
            } 
        });
    </script>
    <script type="text/javascript">
//  js获取url中的参数的方法
    var cid="";
    
    var companyName;
  //var headPicture;
    var name;
    var job;
    var mobile;
    var zuoMobile;
    var mail;
    var weixin;
    var weibo;
    var qq;
    var userdefined;
    //var erCode;
    var mdStore; 
    var cardId;
    
    var ip;
    var open_way;
    
    var goumen;
    var web_url;
    
    var share_title;
    var share_content;
    var share_pic;
    
  //判断当前页面是否转发而来
    var transmitTag=0;
    var openId;
	var province="";
	var city="";
	var district="";
	
    $(document).ready(function(){ 
    	cardId = getQueryString("card_id");
    	cid=getQueryString("cid");
    	//获取ip
    	ip=returnCitySN["cip"]+','+returnCitySN["cname"];
    	
		/* province = getProvinceCodeByName(remote_ip_info["province"]);		
		city = getCityCodeByName(remote_ip_info["city"]);
		district = getCodeByName(remote_ip_info["district"]); */
		
		city = returnCitySN["cname"];
		cityId=getCityCodeByName(city);
    	openId=$.cookie('weixinOpenId');  
    	
    	//判断当前页面是否转发而来
    	if(StringEmpty(getQueryString("isappinstalled"))||StringEmpty(getQueryString("appinstall"))){
			transmitTag=1;
		} else{
			transmitTag=0;
		}
    	cardStore();
		openWay();
	
		openCount();
		
  	    queryCard(cardId);
  	    yewuList();
    });
    
    // 统计打开量 - Yangcl
    function openCount(){
    	var url = "<%=path%>/businessCard/ajaxOpenCardRecord";
    	var data = {
    		"cid" : cid,
    		"browseIp":ip,
    		"openWay": open_way,
    		"cardId" :cardId,
			"openId":openId,
			"provinceId":province,
			"cityId":cityId,
			"areaId":district 
    	};
    	asyncAjax("post" , url , data); 
    }
    
    function asyncAjax(type_, url_ , data_){
        var msg_ = null;
        $.ajax({
            dataType : "text",
            type :type_,
            url : url_,
            data : data_,
            async : true,
            success : function(msg) {
                msg_ = msg;
            },
            error: function(msg) {
                msg_ = msg;
            }
        });
        return msg_;
    }
    

    function queryCard(cardId){
    	var url = "<%=path%>/businessCard/ajaxCompanyCardDetail";
    	$.post(url,{
			"cid" : cid,
			"id" :cardId,
    	},function(e){
    		if(e.status == 200){ 
    			goumen = e.data.showInterprise;    // 企业信息是否显示：1显示0不显示
                gouye = e.data.showBusiness; // 业务信息是否显示：1显示0不显示
                goutui = e.data.showRecommend;   // 推荐信息是否显示：1显示0不显示
    			if(goumen == "1"){
    				// microPortal();
    				drawStoreInfo(e.data.mdStore);
    				$('#info11').show();
    				$('#info1').show();
    			}else if(goumen == '0'){
    				$('#info11').hide();
    				$('#info1').hide();
    			}
                if(gouye == "0"){
                    $("#info2").hide();
                }
                if(goutui == "0"){
                    $("#info3").hide();
                }
                
    			getWeinInfo();
    			cardHtml(e.data);
    			// config();
    		}else{
    		}
    		
    	});
    	
    }
    var access_token=$.cookie('access_token');
    var uid=$.cookie('uid');
   
    
         // 图片加载失败则替换为默认图片 - Yangcl
     function loadDefalutImage(e){
    	 var src_ = "<%=basePath%>/images/marketing/img_load_error.png";  
    	 $(e).attr("src" , src_);
     }
    
     //  获取活动门店信息（查询该活动门店的地址和电话）   
     function drawStoreInfo(storeId_){
    	 if(storeId_ == ""){
    		 return;
    	 }
         var url = "<%=path%>/store/ajaxQueryStore";
         $.post(url,{ 
             "id" : storeId_  
         },function(e){
        	 if(e.status == "200"){
        		 $('#micro_address').html('<img src="<%=path%>/images/marketing/icon_address.png" />' + ' '+ e.data.address + '</li>');
                 $('#micro_phone').html('<img src="<%=path%>/images/marketing/icon_phone.png" />' + ' ' + e.data.phone + '</li>');
        	 }else{
        		 
        	 }
             
         });
     }

    function cardStore(){
        var url = "<%=path%>/company/ajaxCompanyInfo";
        $.post(url,{
           /*  "access_token" : access_token, */
            "id" : cid,
            /* "uid" : uid,
            "card_id" : cardId, */
        },function(e){
            if(e.status == "200"){
                //替换门店照片micro_pic  organization_img
                $("#micro_pic").attr("src" , e.data.logo);
                //替换门店名称
                $("#micro_name").text(e.data.name);
                //修复门店名称在灰框中显示与数据不匹配的bug
                //$('#bm_md_list').html(html);
                var keyWord1 = e.data.business.split(/[,，]/);
                var keyWord2 = '';
                for(var i in keyWord1){
                    keyWord2 += keyWord1[i] + " &nbsp&nbsp&nbsp&nbsp ";
                }
                $('#micro_tag').html(keyWord2);
                $('#business_hours').html(e.data.intro);
                
        <%--         if(StringEmpty(e.data.address) && e.data.address != 'null'){
                    $('#micro_address').html('<img src="<%=path%>/images/marketing/icon_address.png" />' + ' ' + e.data.address);
                }
                if(StringEmpty(e.data.officePhone) && e.data.officePhone != 'null'){
                    $('#micro_phone').html('<img src="<%=path%>/images/marketing/icon_phone.png" />' + ' ' + e.data.officePhone);
                } --%>
            }else{
                //showDialog(data.message);
            }
        });
    }

    

    function cardHtml(data){
    	var html = '';
    	html += '<h6></h6><span>'+data.companyName+'</span><dl class="fix">';
    	html +=	'<dt><img onerror="loadDefalutImage(this)" src="'+data.headPicture+'" /></dt>';
    	html += '<dd><h5>'+data.name+'</h5>';
    	html +=	'<em>'+data.job+'</em></dd></dl>';
    	html += '<p id="cc_zuoyou"><img src="<%=path%>/images/marketing/icon_plume.png"/>'+' '+data.motto+'</p><ul class="fix">';
    	html += '<li id="cc_phone"><img src="<%=path%>/images/marketing/icon11.png" />  '+' '+data.mobile+'</li>';
    	html += '<li id="cc_zuoji"><img src="<%=path%>/images/marketing/icon22.png" />  '+' '+data.telephone+'</li>';
    	html +=	'<li id="cc_mail"><img src="<%=path%>/images/marketing/icon33.png" />  '+' '+data.mail+'</li>';
    	html += '<li id="cc_weixin"><img src="<%=path%>/images/marketing/icon55.png" />  '+' '+data.weixin+'</li>';
    	html += '<li id="cc_weibo"><img src="<%=path%>/images/marketing/icon66.png" />  '+' '+data.weibo+'</li>';
    	html += '<li id="cc_qq"><img src="<%=path%>/images/marketing/icon44.png" />'+' '+data.qq+ '</li></ul>';
    	html += '</ul><em class="k_btn_zzmp" style="display: none;">制作我的名片</em><div class="k_ewm_box"><div id="qrcode"></div><i>长按保存通讯录</i></div><em class="k_icon_right"><img src="<%=path%>/images/marketing/k_icon_right.png" /></em>';
    	
    	$('#qy_card').html(html);
    	makeCode(data);
    	
    	if(!StringEmpty(data.motto)){
    		$('#cc_zuoyou').html('');
    	}
    	if(!StringEmpty(data.telephone)){
    		$('#cc_zuoji').html('');
    	}
    	if(!StringEmpty(data.mail)){
    		$('#cc_mail').html('');
    	}
    	if(!StringEmpty(data.weixin)){
    		$('#cc_weixin').html('');
    	}
    	if(!StringEmpty(data.weibo)){
    		$('#cc_weibo').html('');
    	}
    	if(!StringEmpty(data.qq)){
    		$('#cc_qq').html('');
    	} 
    	share_pic=data.headPicture;
		share_title=data.name;
		share_content=data.companyName;
		
    }
    
    /* 二维码名片生成 */
	function makeCode(data){
		var qrcode = new QRCode(document.getElementById("qrcode"), {
			width : 100,
			height : 100
		});
		
		var a,b=data.name;
		var d=data.job;
		var f=data.companyName;
		var g=data.mobile;
		var j=data.mail;
		
		a = "BEGIN:VCARD";
		if( b!=null || b!=""){
			a+="\r\nN:"+b+";";
		}
		if( d!=null || d!=""){
			a+="\r\nTITLE:"+d;
		}
		if( g!=null || g!=""){
			a+="\r\nTEL;CELL,VOICE:"+g;
		}
		if( j!=null || j!=""){
			a+="\r\nEMAIL;PREF;INTERNET:"+j;
		}
		if(f!=null || f!=""){
			a+="\r\nORG:"+f;
		}
		a += "END:VCARD";
		qrcode.makeCode(a);
	}
    
	//显示业务和推荐活动  
    function yewuList(){
	   	var url = "<%=path%>/businessCard/ajaxCardActivityList";
	   	$.post(url,{
				"cid" : cid,
				"cardId" : cardId,
	   	},function(e){
	   		if(e.status == "200"){
	   			//业务
	   			var yewuActivity = e.activityData;
	   			//推荐
	   			var tuijainActivity = e.operationData;
	   			
	   			if(!StringEmpty(yewuActivity)){
   	    			$("#info2").hide();
   	    		}
	   			if(!StringEmpty(tuijainActivity)){
   	    			$("#info3").hide();
   	    		}
	   			if(!StringEmpty(yewuActivity) && !StringEmpty(tuijainActivity)){
   	    			$("#info2").hide();
   	    			$("#info3").hide();
   	    		}
	   			
	   			var htmlye = '';
	   			
	   			var htmljian = '';
	   	    	  for(var i in yewuActivity){
	   	    		var act_idd = yewuActivity[i].id;
	   	    		var act_yename = yewuActivity[i].name;
	   	    		var act_head_pic = yewuActivity[i].headPic;
	   	    		var act_concent = yewuActivity[i].content;
	   	    		var act_web_yeurl = yewuActivity[i].webUrl+"&cardId="+cardId;
	   	    		var act_share_url = yewuActivity[i].sharePic;
	   	    		if(StringEmpty(act_share_url)){
	   	    	     	htmlye += '<a href="'+act_web_yeurl+'" style="display:block;">'
	   	    	     		+'<div style="background: #fff;border-bottom: 11px solid #F7F7F7;margin-bottom:10px;height: 154px"><dl id="yechu'+act_idd+'" class="fix" style="border-top: 1px solid #eee;"><div style="border-bottom: 1px solid #eee;height: 105px;"><dt><img onerror="loadDefalutImage(this)" style="width:72px; height:72px;" src="'+act_share_url+'" /></dt>';
	   	    		}else{
	   	    			htmlye += '<a href="'+act_web_yeurl+'" style="display:block;">'
	   	    				+'<div style="background: #fff;border-bottom: 11px solid #F7F7F7;margin-bottom:10px;height: 154px"><dl id="yechu'+act_idd+'" class="fix" style="border-top: 1px solid #eee;"><div style="border-bottom: 1px solid #eee;height: 105px;"><dt><img onerror="loadDefalutImage(this)" style="width:72px; height:72px;" src="'+act_head_pic+'" /></dt>';
	   	    		}
	   	    		
	   	    		htmlye += '<dd id="bm_ziding" style="margin-left: -14px;"><p style="color: #03a9f4;">'+act_yename+'</p>';
	   	    		htmlye += '<i class="s_md" style="word-break: break-all;text-overflow: ellipsis;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3; overflow: hidden;">'+act_concent+'</i></dd></div></dl></div></a>';
	   	    	  }
	   	    	$('#bm_yewushow').html(htmlye); 
	   	    	
	   	         for(var j in tuijainActivity){
	   	        	var act_tuijianId = tuijainActivity[j].id;
	   	        	var act_tuipic = tuijainActivity[j].headPic;
	   	        	var act_tuiname = tuijainActivity[j].name;
	   	        	var act_endt = tuijainActivity[j].endTime;
	   	        	var act_count = tuijainActivity[j].joinNum;
	   	        	var act_web_tuiurl = tuijainActivity[j].webUrl+"&cardId="+cardId;
	   	        	var act_browserenshu = tuijainActivity[j].browseNum;
	   	        	var act_share_url = tuijainActivity[j].sharePic;
	   	        	var act_concent = tuijainActivity[j].content;

	   	        	if(StringEmpty(act_share_url)){
	   	        	     htmljian += '<a href="'+act_web_tuiurl+'" style="display:block;"><div class="k_content"  id="chu'+act_tuijianId+'"><dl class="fix"><div style="border-bottom: 1px solid #eee;height: 105px;"><dt><img onerror="loadDefalutImage(this)" style="width:72px; height:72px;" src="'+act_share_url+'"/></dt>' ;
	   	        	}else{
	   	        	     htmljian += '<a href="'+act_web_tuiurl+'" style="display:block;"><div class="k_content"  id="chu'+act_tuijianId+'"><dl class="fix"><div style="border-bottom: 1px solid #eee;height: 105px;"><dt><img onerror="loadDefalutImage(this)" style="width:72px; height:72px;" src="'+act_tuipic+'"/></dt>' ;
	   	        	}
	   	        	htmljian += '<dd style="margin-left: -14px;"><p style="color: #03a9f4;">'+act_tuiname+'</p>';
                     htmljian += '<i class="s_md" style="overflow:hidden;text-overflow:ellipsis;display:-webkit-box; -webkit-box-orient:vertical;-webkit-line-clamp:3; ">'+act_concent+'</i></dd></div></dl></div></a>';
	   	         }
	   		}

	   		$('#bm_xianshi').html(htmljian); 
	   	});
	   }
    //判断打开途径
    function openWay(){
    	//微信微博
        var browser = {
            versions: function() {
                var u = navigator.userAgent,
                    app = navigator.appVersion;
                return { //移动终端浏览器版本信息
                    trident: u.indexOf('Trident') > -1, //IE内核
                    presto: u.indexOf('Presto') > -1, //opera内核
                    webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
                    gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
                    mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
                    ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
                    android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器
                    iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
                    iPad: u.indexOf('iPad') > -1, //是否iPad
                    webApp: u.indexOf('Safari') == -1 //是否web应该程序，没有头部与底部
                };
            }(),
            language: (navigator.browserLanguage || navigator.language).toLowerCase()
        }


        if (browser.versions.mobile) { //判断是否是移动设备打开。browser代码在下面
            var ua = navigator.userAgent.toLowerCase(); //获取判断用的对象

         
            if (browser.versions.ios) {
            	open_way="weixin";
            }
            if (browser.versions.android) {
            	open_way="weibo";
            }
            if (ua.match(/MicroMessenger/i) == "micromessenger") {
                //微信打开
            	open_way="weixin";
            }
            if (ua.match(/WeiBo/i) == "weibo") {
                //微博打开
            	open_way="weibo";
            }
            if (ua.match(/QQ/i) == "qq") {
            	open_way="qq";
                //qq打开
            }
            if(navigator.userAgent.indexOf("MQQBrowser")>-1){
            	open_way="qq";
            }
        } else {
        	open_way="pc";
            //否则就是PC浏览器打开
        }

    
    }
  //判断字符串是否为空
	function StringEmpty(content) {
		if (content == undefined || content == "" || content == null) {
			return false;
		} else {
			return true;
		}
	}
    
	 var timestamp;
	 var signature;
	 var nonceStr;
	 var link_url;
	 var appid;
	    function getWeinInfo(){
	    	 web_url = window.location.href.split('#')[0];  
	    	/* web_url = web_url.replace(/\&/g, '%26');  */
	    	/* web_url=encodeURIComponent(web_url); */
	    	var url="<%=path%>/api/auth/share";
			$.post(url, {
				"url" : web_url,
			}, function(data) {
				timestamp=data.timestamp;
				signature=data.signature;
				nonceStr=data.nonceStr;
				link_url=data.url;
				var reg = new RegExp("%26","g");
				link_url=link_url.replace(reg,"&");
				appid=data.appId; 
				config();
			});
	    }
	    
	    function config(){
	    	wx.config({
		        debug: false,
		        appId: appid,
		        timestamp: timestamp,
		        nonceStr: nonceStr,
		        signature: signature,
		        jsApiList: [
		          'checkJsApi',
		          'onMenuShareTimeline',
		          'onMenuShareAppMessage',
		          'onMenuShareQQ',
		          'onMenuShareWeibo',
		          'hideMenuItems',
		          'showMenuItems',
		          'hideAllNonBaseMenuItem',
		          'showAllNonBaseMenuItem',
		          'translateVoice',
		          'startRecord',
		          'stopRecord',
		          'onRecordEnd',
		          'playVoice',
		          'pauseVoice',
		          'stopVoice',
		          'uploadVoice',
		          'downloadVoice',
		          'chooseImage',
		          'previewImage',
		          'uploadImage',
		          'downloadImage',
		          'getNetworkType',
		          'openLocation',
		          'getLocation',
		          'hideOptionMenu',
		          'showOptionMenu',
		          'closeWindow',
		          'scanQRCode',
		          'chooseWXPay',
		          'openProductSpecificView',
		          'addCard',
		          'chooseCard',
		          'openCard'
		        ]
		    });

	    	
	    	 wx.ready(function () {
	 	    	  // 1 判断当前版本是否支持指定 JS 接口，支持批量判断
	 	    	 /*  document.querySelector('#checkJsApi').onclick = function () {
	 	    	    
	 	    	  }; */
	 	    	  wx.checkJsApi({
	 	    	      jsApiList: [
	 	    	        'getNetworkType',
	 	    	        'previewImage'
	 	    	      ],
	 	    	      success: function (res) {
	 	    	      }
	 	    	    });
	 	    	  
	 	    	  // 2. 分享接口
	 	    	  // 2.1 监听“分享给朋友”，按钮点击、自定义分享内容及分享结果接口
	 	    	
	 	    	   /*  document.querySelector('#onMenuShareAppMessage').onclick = function () { */
	 				    wx.onMenuShareAppMessage({
	 				      title: share_title,
	 				      desc: share_content,
	 				      link: link_url,
	 				      imgUrl: encodeURI(share_pic),
	 				      trigger: function (res) {
	 				      },
	 				      success: function (res) {
	 				    	 transmit("time_line");
	 				      },
	 				      cancel: function (res) {
	 				      },
	 				      fail: function (res) {
	 				      }
	                 });
	 	    	
	 				   wx.onMenuShareTimeline({
	 					  title: share_title,
	 				      desc: share_content,
	 				      link: link_url,
	 				      imgUrl: share_pic,
	 	 	    	      trigger: function (res) {
	 	 	    	      },
	 	 	    	      success: function (res) {
	 	 	    	    	transmit("time_line");
	 	 	    	      },
	 	 	    	      cancel: function (res) {
	 	 	    	      },
	 	 	    	      fail: function (res) {
	 	 	    	      }
	 	 	    	    });
	 				   wx.onMenuShareQQ({
	 					  title: share_title,
	 				      desc: share_content,
	 				      link: link_url,
	 				      imgUrl: share_pic,	 				      
	 				      trigger: function (res) {
	 				      },
	 				      complete: function (res) {
	 				      },
	 				      success: function (res) {
	 				    	 transmit("qq");
	 				      },
	 				      cancel: function (res) {
	 				      },
	 				      fail: function (res) {
	 				      }
	 				    });
	 	    	   
	 	    	  // 2.2 监听“分享到朋友圈”按钮点击、自定义分享内容及分享结果接口
	 	    	
	 	    	   /*  wx.onMenuShareTimeline({
	 	    	      title: '互联网之子',
	 	    	      link: 'http://movie.douban.com/subject/25785114/',
	 	    	      imgUrl: 'http://img3.douban.com/view/movie_poster_cover/spst/public/p2166127561.jpg',
	 	    	      trigger: function (res) {
	 	    	        alert('用户点击分享到朋友圈');
	 	    	      },
	 	    	      success: function (res) {
	 	    	        alert('已分享');
	 	    	      },
	 	    	      cancel: function (res) {
	 	    	        alert('已取消');
	 	    	      },
	 	    	      fail: function (res) {
	 	    	        alert(JSON.stringify(res));
	 	    	      }
	 	    	    });
	 	    	 
	 	    	  // 2.3 监听“分享到QQ”按钮点击、自定义分享内容及分享结果接口
	 	    	
	 	    	    wx.onMenuShareQQ({
	 	    	      title: '互联网之子',
	 	    	      desc: '在长大的过程中，我才慢慢发现，我身边的所有事，别人跟我说的所有事，那些所谓本来如此，注定如此的事，它们其实没有非得如此，事情是可以改变的。更重要的是，有些事既然错了，那就该做出改变。',
	 	    	      link: 'http://movie.douban.com/subject/25785114/',
	 	    	      imgUrl: 'http://img3.douban.com/view/movie_poster_cover/spst/public/p2166127561.jpg',
	 	    	      trigger: function (res) {
	 	    	        alert('用户点击分享到QQ');
	 	    	      },
	 	    	      complete: function (res) {
	 	    	        alert(JSON.stringify(res));
	 	    	      },
	 	    	      success: function (res) {
	 	    	        alert('已分享');
	 	    	      },
	 	    	      cancel: function (res) {
	 	    	        alert('已取消');
	 	    	      },
	 	    	      fail: function (res) {
	 	    	        alert(JSON.stringify(res));
	 	    	      }
	 	    	    }); */
	 	    	   
	 	    	  });
	    }
  
	    //转发
		function transmit(transmit_way) {
			var url="<%=path%>/transmit/ajaxShareCard";
			$.post(url, {
				"cid" : cid,
				"cardId" : cardId,
				"transmitTag": transmitTag,
				"transmitWay": transmit_way,
				"ip": ip,
			    "openId":openId,       
				"provinceId":province,
				"cityId":city,
				"areaId":district,
			}, function(e) {
				
			});

		} 	 
		function getQueryString(name) {
			var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
			var r = window.location.search.substr(1).match(reg);
			if (r != null)
				return unescape(r[2]);
			return null;
        }
		
		<%--
		$(window).load(function() { 
			 createBrowse();
		});
		
		
		  //浏览
		 function createBrowse() {
			var url = "<%=path%>/businessCard/browsecard";
	    	$.post(url,{
				"cid" : cid,
				"id" :cardId,
				"browse_ip" : ip, 
				"open_way" :open_way,
				"open_id":openId,
				"province":province,
				"city":city,
				"district":district,
	    	},function(data){
				
			});
		} --%>
    </script>
    
</body>
</html>

